package com.dragon.mmochat.message;

import com.dragon.mmochat.MmochatConstant;
import com.skymobi.buffer.SkymobiBuffer;
import com.skymobi.message.SkymobiModuleMessage;

public class Mmochat_SetMixWuDaoWordsToServerList extends SkymobiModuleMessage {
	private int srcInstId = 0; // 当前服的实例号
	int roleId;
	private String name;
	String words;
	int levelRange = 0;// 10,20,30,...,120

	public Mmochat_SetMixWuDaoWordsToServerList() {
		setMsgCode(MmochatConstant.MSGCODE_MMOCHAT_C_1_36);
	}

	public Mmochat_SetMixWuDaoWordsToServerList(int dstId) {
		setDstId(dstId); // 另一个服务器的实例号
		setMsgCode(MmochatConstant.MSGCODE_MMOCHAT_C_1_36);
	}

	@Override
	protected void decodeBody(SkymobiBuffer in) {
		srcInstId = in.getInt();
		roleId = in.getInt();
		name = in.getPrefixedString(2);
		words = in.getPrefixedString(2);
		levelRange = in.getInt();
	}

	@Override
	protected void encodeBody(SkymobiBuffer out) {
		out.putInt(srcInstId);
		out.putInt(roleId);
		out.putPrefixedString(name, 2);
		out.putPrefixedString(words, 2);
		out.putInt(levelRange);
	}

	public int getSrcInstId() {
		return srcInstId;
	}

	public void setSrcInstId(int srcInstId) {
		this.srcInstId = srcInstId;
	}

	public int getRoleId() {
		return roleId;
	}

	public void setRoleId(int roleId) {
		this.roleId = roleId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getWords() {
		return words;
	}

	public void setWords(String words) {
		this.words = words;
	}

	public int getLevelRange() {
		return levelRange;
	}

	public void setLevelRange(int levelRange) {
		this.levelRange = levelRange;
	}

}
